<script>
	/**
	 * vuex管理登陆状态，具体可以参考官方登陆模板示例
	 */
	import {
		mapMutations
	} from 'vuex';
	export default {
		onUniNViewMessage: function(e) {
			console.log("App.vue收到数据")
			console.log(JSON.stringify(e.data))
		},
		globalData: {
			text: 'text'
		},
		methods: {
			...mapMutations(['login']),
		},
		onLaunch: function() {

			//#ifdef APP-PLUS
			plus.screen.lockOrientation('portrait-primary'); //锁定屏幕方向 
			
			// APP检测更新 具体可以参考：https://ask.dcloud.net.cn/article/35667
			//#endif
      let userInfo = uni.getStorageSync('userInfo') || '';
			if(userInfo.UserAccountID){
				//更新登陆状态
				uni.getStorage({
					key: 'USER_KEY',
					success: (res) => {
						this.login(res.data);
					}
				});
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
	}
</script>

<style lang='scss'>
	/*
		全局公共样式和字体图标
	*/
   @import '@/common/uni.css';
	/* #ifndef APP-PLUS-NVUE */
	@font-face {
		font-family: mallicon;
		font-weight: normal;
		font-style: normal;
		/* src: url('https://at.alicdn.com/t/font_1078604_w4kpxh0rafi.ttf') format('truetype');//旧 */
		src: url('https://at.alicdn.com/t/font_2338311_s6xfwxs9a1e.ttf') format('truetype');//新
	}

	.mallicon {
		font-family: "mallicon" !important;
		font-size: 16px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	.icon-daifukuan:before {
		content: "\e620";
	}

	.icon-daifahuo:before {
		content: "\e621";
	}
	
	.icon-daishouhuo:before {
		content: "\e622";
	}

	.icon-yiwancheng:before {
		content: "\e623";
	}

	.icon-xuanzhong:before {
		content: "\e624";
	}

	.icon-jiahao:before {
		content: "\e625";
	}
	.icon--jianhao:before {
		content: "\e626";
	}
	/* 暂时不知道是什么 */
	/* .icon-arrow-left-bottom:before {
		content: "\e602";
	}

	.icon-you:before {
		content: "\e606";
	} */

	.icon-shangyiye:before {
		content: "\e627";
	}

	.icon-dizhi:before {
		content: "\e629";
	}

	.icon-shezhi:before {
		content: "\e61c";
	}

	.icon-sousuo:before {
		content: "\e628";
	}

	.icon-sanjiao:before {
		content: "\e61f";
	}

	.icon-qiehuan:before {
		content: "\e61e";
	}

	.icon-bianji:before {
		content: "\e61d";
	}

	.icon-shanchu:before {
		content: "\e61a";
	}

	.icon-guanbi1:before {
		content: "\e619";
	}

	.icon-guanbi2:before {
		content: "\e618";
	}

	.icon-xiangyou:before {
		content: "\e617";
	}

	.icon-xiangzuo:before {
		content: "\e616";
	}

	.icon-laba:before {
		content: "\e630";
	}

	.icon-remai:before {
		content: "\e631";
	}

	.icon-tuangou:before {
		content: "\e632";
	}

	.icon-paiming:before {
		content: "\e633";
	}

	.icon-pingpai:before {
		content: "\e634";
	}

	.icon-danwei:before {
		content: "\e635";
	}

	.icon-hezuohuoban:before {
		content: "\e636";
	}

	.icon-shangdian:before {
		content: "\e637";
	}

	.icon-shizhong:before {
		content: "\e638";
	}
	
	/* #endif */



	/* #ifndef APP-PLUS-NVUE */
	view,
	scroll-view,
	swiper,
	swiper-item,
	cover-view,
	cover-image,
	icon,
	text,
	rich-text,
	progress,
	button,
	checkbox,
	form,
	input,
	label,
	radio,
	slider,
	switch,
	textarea,
	navigator,
	audio,
	camera,
	image,
	video {
		box-sizing: border-box;
	}

	image {
		will-change: transform;
	}

	/* #endif */
	/* 骨架屏替代方案 */
	.Skeleton {
		background-color: #f3f3f3;
		padding: 20upx 0;
		border-radius: 8upx;
	}

	/* 图片载入替代方案 */
	/* #ifndef APP-PLUS-NVUE */
	.image-wrapper {
		font-size: 0;
		background-color: #f3f3f3;
		border-radius: 4px;

		image {
			width: 100%;
			height: 100%;
			transition: .6s;
			opacity: 0;

			&.loaded {
				opacity: 1;
			}
		}
	}

	/* #endif */
	.clamp {
		overflow: hidden;
		text-overflow: ellipsis;
		/* #ifndef APP-PLUS-NVUE */
		white-space: nowrap;
		display: block;
		/* #endif */
	}

	.common-hover {
		background-color: #f5f5f5;
	}

	/*边框*/
	.b-b:after,
	.b-t:after {
		position: absolute;
		z-index: 3;
		left: 0;
		right: 0;
		height: 0;
		/* #ifndef APP-PLUS-NVUE */
		content: '';
		/* #endif */
		transform: scaleY(.5);
		border-bottom-width: 1px;
		border-bottom-style: solid;
		border-bottom-color: #E4E7ED;
		/* border-bottom-: 1px solid $border-color-base; */
	}

	.b-b:after {
		bottom: 0;
	}

	.b-t:after {
		top: 0;
	}

	/* button样式改写 */
	/* #ifndef APP-PLUS-NVUE */
	uni-button,
	button {
		height: 80upx;
		line-height: 80upx;
		font-size: 30upx;
		font-weight: normal;

		&.no-border:before,
		&.no-border:after {
			border-width: 0px;
		}
	}

	uni-button[type=default],
	button[type=default] {
		color: #303133;
	}

	/* #endif */
	/* input 样式 */
	.input-placeholder {
		color: #999999;
	}

	.placeholder {
		color: #999999;
	}
</style>
